<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Insert title here</title>
<link rel="stylesheet" media="screen" href="../static/bootstrap/css/bootstrap.min.css" th:href="@{/bootstrap/css/bootstrap.min.css}"/>
<script th:src="@{/angular.min.js}" src="../static/angular.min.js"></script>
<script th:src="@{/pagination.js}" src="../static/pagination.js"></script>
</head>
<body>
	<div style="margin: 100px 50px" ng-app="myApp"  ng-controller="paginationController">
		<table class="table table-striped table-bordered">
			<tr>
				<td colspan="9" align="center">
					<h3><b>监听信息列表</b></h3>
				</td>
			</tr>
			<tr class="success">
				<th>队列名称</th>
				<th>推送接口</th>
				<th>参数名称</th>
				<th>监听时间</th>
				<th>监听状态</th>
				<th>操作</th>
			</tr>
			
			<tr ng-repeat="connectinfor in connectInfors">
				<td ng-bind="connectinfor.queuename"></td>
				<td ng-bind="connectinfor.callbackurl"></td>
				<td ng-bind="connectinfor.callbackparam"></td>
				<td ng-bind="connectinfor.updatetime | date:'yyyy-MM-dd HH:mm:ss'"></td>
				<td ng-switch="connectinfor.state">
					<span ng-switch-when="0">未开启</span>
					<span ng-switch-when="1">已开启</span>
				</td>
				<td ng-switch="connectinfor.state">
					<a role="button" class="btn btn-primary btn-sm" ng-switch-when="1" >已开启</a>
					<a role="button" class="btn btn-primary btn-sm" ng-switch-when="0" ng-click="startListener(connectinfor.id)">未开启</a>
				</td>
				
				<!-- 
				<td th:switch="${connectinfor.state}">
					<b>
						<span th:case="1">已开启</span>
						<span th:case="0">未开启</span>
					</b>
				</td>
				<td th:switch="${connectinfor.state}">
					<a role="button" class="btn btn-primary btn-sm" th:case="1" th:disabled="true">已开启</a>
					<a role="button" class="btn btn-primary btn-sm" th:case="0" th:href="@{/start(id=${connectinfor.id})}">未开启</a>
				</td> -->
			</tr>
		</table>
		<nav>
			<ul th:class="pagination">
				<li class="{{pre_btn}}">
					<a ng-click="Previous()">
						<span>上一页</span>
					</a>
				</li>
				<li ng-repeat="page in pageList" ng-class="{active: isActivePage(page)}">
					<a ng-click="selectPage(page)">{{ page }}</a>
				</li>
				<li class="{{next_btn}}">
					<a ng-click="Next()">
						<span>下一页</span>
					</a>
				</li>
				<li class="disabled">
					<span>共 {{pages}}</span>
				</li>
			</ul>
		</nav>
	</div>
	<script type="text/javascript">
		function startListener1(id){
			alert(id);
		}
	</script>
</body>
</html>